﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using Portal.Web.Model;
using Portal.Cms.Bussiness;
using Portal.Web.Utility;
using Portal.Cms.Utility;
using Portal.Core;
using Portal.Cms.Model;

namespace Portal.Cms.Render
{
    public class WorkflowCmsDataNewsPreviewUrl : WorkflowPreviewTemplate
    {
        public override string ServiceId
        {
            get
            {
                return "News";
            }
        }

        public override string ServiceName
        {
            get
            {
                return "Xem chi tiết tin";
            }
        }

        public override RetWorkflowPreviewParam GetPreviewUrl(string SiteId, WorkflowPreviewParam OWorkflowPreviewParam)
        {
            SiteParam OSiteParam = WebEnvironments.CreateSiteParam(SiteId);
            CmsDataCls OCmsData = CmsUtility.CreateCmsBussinessProcess(SiteId).CreateCmsProcess(SiteId).CreateCmsDataModel(null, SiteId, OWorkflowPreviewParam.ObjectId);

            RetWorkflowPreviewParam ORetWorkflowPreviewParam = new RetWorkflowPreviewParam();
            ORetWorkflowPreviewParam.Url = OSiteParam.HttpRoot + "/admin/modules/cms/PreviewCmsData.aspx?gid=" + OCmsData.frkGroupDataId + "&CmsDataId=" + OCmsData.DataId + "&back=../../home.aspx";
            return ORetWorkflowPreviewParam;
        }

        //public override string GetPreviewUrl(string SiteId, string ObjectId)
        //{
        //    SiteParam OSiteParam = WebEnvironments.CreateSiteParam(SiteId);
        //    CmsDataCls OCmsData = CmsUtility.CreateCmsBussinessProcess(SiteId).CreateCmsProcess(SiteId).CreateCmsDataModel(null, SiteId, ObjectId);
        //    //UpdateCmsData.aspx?gid=454afa0a-f5bb-4ea3-99c5-9bd2162c1e78&CmsDataId=7af54606-a49a-4025-b034-4ecd95f87e2c
        //    string Url=OSiteParam.HttpRoot+"/admin/modules/cms/PreviewCmsData.aspx?gid="+OCmsData.frkGroupDataId+"&CmsDataId="+OCmsData.DataId+"&back=../../home.aspx";
        //    return Url;
        //}
    }
}
